import request from '@/config/axios'

// 项目需求基础信息表单 VO
export interface RequireBasicInfoVO {
  id: number // 自增主键
  requirementId: string // 需求唯一编号
  requirementName: string // 需求名称
  requirementDescription: string // 需求详细描述
  requirementLevel: string // 需求层级
  parentRequirementId: string // 上级需求编号（顶级需求为空）
  requirementSource: string // 需求来源
}

// 项目需求基础信息表单 API
export const RequireBasicInfoApi = {
  // 查询项目需求基础信息表单分页
  getRequireBasicInfoPage: async (params: any) => {
    return await request.get({ url: `/project/require-basic-info/page`, params })
  },

  // 查询项目需求基础信息表单详情
  getRequireBasicInfo: async (id: number) => {
    return await request.get({ url: `/project/require-basic-info/get?id=` + id })
  },

  // 新增项目需求基础信息表单
  createRequireBasicInfo: async (data: RequireBasicInfoVO) => {
    return await request.post({ url: `/project/require-basic-info/create`, data })
  },

  // 修改项目需求基础信息表单
  updateRequireBasicInfo: async (data: RequireBasicInfoVO) => {
    return await request.put({ url: `/project/require-basic-info/update`, data })
  },

  // 删除项目需求基础信息表单
  deleteRequireBasicInfo: async (id: number) => {
    return await request.delete({ url: `/project/require-basic-info/delete?id=` + id })
  },

  // 导出项目需求基础信息表单 Excel
  exportRequireBasicInfo: async (params) => {
    return await request.download({ url: `/project/require-basic-info/export-excel`, params })
  },
}